package com.framework.net;

import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;
import java.net.UnknownHostException;
/**
 * 目的地址 10.1.28.146
 * 工具类，完成TCP数据发送
 * 固定端口 65534
 * @author root
 *
 */
public class SendTCPSocket {
	Socket socket;
	
	public void simpleSendByte(byte[] data){
		OutputStream out ;
		try {
			socket = new Socket("10.1.28.146",65534);
			out = socket.getOutputStream();
			out.write(data);
			out.flush();
			out.close();
			socket.close();
		} catch (UnknownHostException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}
}
